﻿<%@ page import="java.util.*" %>
<%@ page import="com.byjyate.rssdreamwork.*" %>
<div class="post">
<%
	String UrlPrefix = request.getRequestURL().toString().replace("settings/listrss.jsp", "rss?rssid=");
	RssInfoRepository rssInfoRepo = new RssInfoRepository();
    List<RssInfo> rssInfos = null;
    try {
    	rssInfos = rssInfoRepo.getRssInfos();
    	for (RssInfo rssInfo : rssInfos) {
%>
			<h2 class="title"><a href="/rss?rssid=<%= rssInfo.getRssId() %>"><%= rssInfo.getTitle() %></a></h2>
			<div class="entry">
				<strong>描述</strong>：<%= rssInfo.getDescription() %>
				<br>
				<strong>链接</strong>：<a href="<%= rssInfo.getLink() %>"><%= rssInfo.getLink() %></a>
				<br>
				<strong>所有者</strong>：<%= rssInfo.getOwner() %>
				<br>
				<strong>处理指令</strong>：
				
				<% for (String command : rssInfo.getTransformCommandList()) { %>
					<xmp><%= command %></xmp>
				<% } %>
			</div>
			<div class="meta">
				<p class="links">
					<a href="/settings/editrss.jsp?rssid=<%= rssInfo.getRssId() %>" class="comments">编辑</a>
					<a href="/tasks/pubsubhubbub?url=<%= UrlPrefix + rssInfo.getRssId() %>&from=<%= request.getRequestURL().toString() %>" class="comments">推送更新</a>
					<a href="/settings/deleterss?rssid=<%= rssInfo.getRssId() %>" class="comments">删除</a>
					<a href="/tasks/subscribe?url=<%= UrlPrefix + rssInfo.getRssId() %>&from=<%= request.getRequestURL().toString() %>" class="comments">订阅</a>
				</p>
          </div>
			
<%
    	}
    } catch (Exception e) {}
    rssInfoRepo.close();
%>
</div>